//
//  GroupManagerHeaderView.m
//  ChangChat
//
//  Created by Cocoa on 2019/10/15.
//  Copyright © 2019 yibai. All rights reserved.
//

#import "GroupManagerHeaderView.h"

@implementation GroupManagerHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}
- (void)setupUI {
    
    self.headLabel = [UILabel k_labelWithText:@"编辑群资料" boldFontSize:15 textColor:UIColor.k_t2Color];
    self.leftLabel = [UILabel k_labelWithText:@"群头像" fontSize:15 textColor:UIColor.k_t2Color];
    self.iconImgView = UIImageView.new;
    self.iconImgView.layer.cornerRadius = 25;
    self.iconImgView.layer.masksToBounds = YES;
    self.actionBtn = [UIButton new];
    
    UIView *lineV = [UIView k_lineView];
    
    
    [self addSubview:self.headLabel];
    [self addSubview:self.leftLabel];
    [self addSubview:self.iconImgView];
    [self addSubview:self.actionBtn];
    [self addSubview:lineV];
    
    [self.headLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_offset(15);
    }];
    
    [self.iconImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_offset(-15);
        make.top.equalTo(self.headLabel.mas_bottom).offset(10);
        make.bottom.mas_offset(-15);
        make.size.mas_equalTo(CGSizeMake(50, 50));
    }];
    
    [self.leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.headLabel);
        make.centerY.equalTo(self.iconImgView);
    }];
    [self.actionBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self);
    }];
    [self mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(ScreenWidth);
    }];
    
    [lineV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(15);
        make.right.mas_offset(0);
        make.bottom.mas_offset(0);
        make.height.mas_equalTo(1.0f);
    }];
    
}

@end
